Skip to content

fix: ignore stray oauth callback requests - #481

Merged
Colin Francis (colifran) merged 4 commits into
langchain-ai:mainfrom
HwangJohn:fix/oauth-callback-stray-requests
Jul 29, 2026
Merged

fix: ignore stray oauth callback requests#481
Colin Francis (colifran) merged 4 commits into
langchain-ai:mainfrom
HwangJohn:fix/oauth-callback-stray-requests

Conversation

@HwangJohn

Copy link
Copy Markdown
Contributor

Summary

  • keep the OAuth callback server waiting when browsers request non-callback paths like /favicon.ico
  • only reject the pending OAuth flow for malformed real /callback requests
  • cover the redirect URI, stray request, missing callback data, provider error, and shutdown trailing request cases

Why

Browsers and local tooling can send extra requests to the loopback OAuth server before the provider redirect completes. Those requests should not fail the login attempt before the real callback arrives.

No dedicated issue; found during an OAuth callback hardening sweep.

Testing

  • corepack pnpm exec vitest run test/oauth-callback-server.test.ts passed
  • corepack pnpm run format:check passed
  • corepack pnpm run lint:check passed
  • corepack pnpm run typecheck passed
  • git diff --check passed
  • corepack pnpm test was attempted on Windows and still fails outside this change in existing test/env-behavior.test.ts HOME/permission assertions plus Mermaid/jsdom timeout tests

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8b2faac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openwiki Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@colifran Colin Francis (colifran) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - thanks HwangJohn!

@colifran
Colin Francis (colifran) merged commit b3b0b43 into langchain-ai:main Jul 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants